{extend name="public/base"}
{block name='main'}
<!-- 广告 -->
<div class="layui-container mb20">
    <div class="banner-wrap"><!--矩形广告位-->
    </div>
</div>
<!-- 广告 end-->
<!-- 主体开始 -->
<style type="text/css">
    .layui-nav-tree {
        width: 200px !important;
    }
</style>
<div class="layui-container fly-marginTop fly-user-main">
    {include file="ucenter/ucleft" /}
    <div class="site-tree-mobile layui-hide">
        <i class="layui-icon">&#xe602;</i>
    </div>
    <div class="site-mobile-shade"></div>

    <div class="site-tree-mobile layui-hide">
        <i class="layui-icon">&#xe602;</i>
    </div>
    <div class="site-mobile-shade"></div>


    <div class="fly-panel fly-panel-user" pad20>
        <div class="layui-tab layui-tab-brief" lay-filter="user">
            <ul class="layui-tab-title" id="LAY_mine">
                <li class="layui-this"><a href="{:url('ucenter/index')}">我的资料</a></li>
            </ul>
            <div class="layui-tab-content" style="padding: 20px 0;">
                <form class="layui-form layui-form-pane" action="">
                    <div class="layui-form-item" pane>
                        <label for="gender" class="layui-form-label">性别</label>
                        <div class="layui-input-block">
                            <input type="radio" id="id_male" name="gender" title="男"  {if $info.gender== 1}checked{/if}  value="1">
                            <input type="radio" id="id_male" name="gender" title="女"  {if $info.gender == 0}checked{/if} value="0">
                            <input type="radio" id="id_male" name="gender" title="保密" {if $info.gender== 2}checked{/if}  value="2">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="birthday" class="layui-form-label">生日</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="birthday" id="birthday"  placeholder="yyyy-MM-dd">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="city" class="layui-form-label">城市</label>
                        <div id="citys">
                            <div class="layui-input-inline">
                                <select name="province" lay-filter="province">
                                </select>
                            </div>
                            <div class="layui-input-inline">
                                <select name="city" lay-filter="city">
                                </select>
                            </div>
                            <div class="layui-input-inline">
                                <select name="county" lay-filter="county">
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="city" class="layui-form-label">联系QQ</label>
                        <div class="layui-input-inline">
                            <input type="text" name="contact" value="{$info.contact}" class="layui-input"/>
                        </div>
                    </div>

                    <div class="layui-form-item layui-form-text">
                        <label for="sign" class="layui-form-label">自我介绍</label>
                        <div class="layui-input-block">
                            <textarea placeholder="随便写些什么刷下存在感" name="intro" class="layui-textarea"
                                      style="height: 80px;">{$info.intro}</textarea>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <button class="layui-btn" key="set-mine" lay-filter="upbtn" lay-submit="">确认修改</button>
                    </div>
                </form>


            </div>

        </div>
    </div>
</div>

<script src="__PUBLIC__/theme/blueideal/mods/jquery.min.js"></script>
<script src="__PUBLIC__/theme/blueideal/mods/citys.js"></script>
<script>
    layui.use(['form', 'laydate', 'jquery', 'upload'], function () {
        var form = layui.form, laydate = layui.laydate, $ = layui.jquery, upload = layui.upload;

        //初始化时间
        var date = {
            elem: '#birthday'
            , isInitValue: true
        }

        var value = parseInt('{$info.byear}');
        if (value > 0) {
            date.value = "{$info.byear}-{$info.bmonth}-{$info.bday}";
        }

        laydate.render(date);

        pca.init('select[name=province]', 'select[name=city]', 'select[name=county]', '{$info.province}', '{$info.city}', '{$info.county}');

        // 提交基本设置
        form.on('submit(upbtn)', function (data) {
            // 提交到方法 默认为本身
            $.post("{:url('ucenter/index')}", data.field, function (res) {
                if (res.status == 1) {
                    layer.msg(res.msg, {time: 1800}, function () {
                        location.reload();  //成功后刷新当前页
                    });
                } else {
                    layer.msg(res.msg, {time: 1800});

                }
            });
            return false;
        });

        form.render();
    });

</script>
<script>
    layui.cache.page = 'user';
    layui.config({
        base: '__PUBLIC__/theme/blueideal/mods/' //这里实际使用时，建议改成绝对路径
    }).extend({
        fly: 'index'
    }).use('fly');
</script>
<!-- 主体结束 -->

{/block}